<local:ChartExBase x:Class="WPFExcelReport.Chart.ChartDesign"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
                     xmlns:ucd="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
                     xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                     xmlns:local="clr-namespace:WPFExcelReport.Chart" 
        > 
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions> 
        <ScrollViewer Grid.Row="1" BorderThickness="0">
            <StackPanel Margin="15">
                <TextBlock Text="{Binding Source={Localization:Translate Word=显示选项}}" Style="{StaticResource SectionHeaderSmallTextStyle}" />
                <CheckBox IsChecked="{Binding Path=IsRowColumnSwitched, Mode=TwoWay}">
                    <TextBlock Text="{Binding Source={Localization:Translate Word=坐标转换}}" Style="{StaticResource ContentTextStyle}" />
                </CheckBox>
                <CheckBox IsChecked="{Binding Path=IsTitleVisible, Mode=TwoWay}">
                    <TextBlock Text="{Binding Source={Localization:Translate Word=标题可见}}" Style="{StaticResource ContentTextStyle}"/>
                </CheckBox>
                <CheckBox IsChecked="{Binding Path=IsLegendVisible, Mode=TwoWay}">
                    <TextBlock Text="{Binding Source={Localization:Translate Word=图列可见}}" Style="{StaticResource ContentTextStyle}" />
                </CheckBox>
                <CheckBox IsChecked="{Binding Path=DarkLayout, Mode=TwoWay}">
                    <TextBlock Text="{Binding Source={Localization:Translate Word=深色}}" Style="{StaticResource ContentTextStyle}" />
                </CheckBox>
                <TextBlock Text="{Binding Source={Localization:Translate Word=字体大小}}" Style="{StaticResource SectionHeaderSmallTextStyle}" />
                <TextBlock Style="{StaticResource ContentTextStyle}" Text="{Binding Source={Localization:Translate Word=涉及所有字体}}" />
                <ComboBox Tag="{Binding Path=SelectedFontSizeString}" ItemsSource="{Binding Path=FontSizes}" SelectedItem="{Binding Path=SelectedFontSize, Mode=TwoWay}" >
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Foreground="Black" Text="{Binding}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <TextBlock Text="{Binding Source={Localization:Translate Word=配色板}}" Style="{StaticResource SectionHeaderSmallTextStyle}" />
                <TextBlock Style="{StaticResource ContentTextStyle}" Text="{Binding Source={Localization:Translate Word=自定义色板}}" />
                <ComboBox Tag="{Binding Path=SelectedPalette.Key}" ItemsSource="{Binding Path=Palettes}" SelectedItem="{Binding Path=SelectedPalette, Mode=TwoWay}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Foreground="Black" Text="{Binding Path=Key}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <TextBlock Text="{Binding Source={Localization:Translate Word=环图内径}}" Style="{StaticResource SectionHeaderSmallTextStyle}" />
                <ComboBox Tag="{Binding Path=SelectedDoughnutInnerRadiusRatioString}" ItemsSource="{Binding Path=DoughnutInnerRadiusRatios}" SelectedItem="{Binding Path=SelectedDoughnutInnerRadiusRatio, Mode=TwoWay}" >
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Foreground="Black" Text="{Binding}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>

                <TextBlock Text="{Binding Source={Localization:Translate Word=选中颜色}}" Style="{StaticResource SectionHeaderSmallTextStyle}" />
                <TextBlock Style="{StaticResource ContentTextStyle}" Text="{Binding Source={Localization:Translate Word=选中颜色}}" />

                <ComboBox Foreground="Black" Tag="{Binding Path=SelectedBrush}" ItemsSource="{Binding Path=SelectionBrushes}" SelectedItem="{Binding Path=SelectedBrush, Mode=TwoWay}" />

                <TextBlock Text="{Binding Source={Localization:Translate Word=数据清单}}" Style="{StaticResource SectionHeaderSmallTextStyle}" />
                <TextBlock Style="{StaticResource ContentTextStyle}" Text="{Binding Source={Localization:Translate Word=The chart can display a fixed number of series or a dynamic list of series. Change the values to see the changes within the charts or add new series.}}" />
                <Button Command="{Binding Path=AddSeriesCommand}" Style="{StaticResource BorderButton}" Content="增加数据" Margin="5 5 5 5" />
                <Border BorderThickness="2" BorderBrush="Black" Background="#efefef">
                    <ItemsControl
                        Margin="5"
                        x:Name="parentList"
                        VerticalAlignment="Stretch"
                        HorizontalAlignment="Stretch"
                        VerticalContentAlignment="Stretch"
                        HorizontalContentAlignment="Stretch"
                        ItemsSource="{Binding Path=Series}"
                        Tag="{Binding Path=SelectedItem, Mode=TwoWay}" >
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Source={Localization:Translate Word=Series}}" Style="{StaticResource SeriesHeader}"/>
                                        <TextBlock Text="{Binding Path=SeriesDisplayName}" Style="{StaticResource SeriesHeader}" />
                                    </StackPanel>
                                    <ListBox 
                                        BorderThickness="0" 
                                        Background="Transparent"
                                        ItemContainerStyle="{StaticResource ListBoxItemStyle}"
                                        ItemsSource="{Binding Path=Items}" 
                                        SelectedItem="{Binding Path=Tag, Mode=TwoWay, ElementName=parentList}">
                                        <ListBox.ItemTemplate>
                                            <DataTemplate>
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="auto" />
                                                        <ColumnDefinition Width="*" />
                                                    </Grid.ColumnDefinitions>
                                                    <TextBlock Grid.Column="0" Text="{Binding Path=Category}" />
                                                    <TextBox Width="50" Background="White" Margin="0 0 0 0" BorderBrush="DarkGray" Grid.Column="1" HorizontalAlignment="Right" Text="{Binding Path=Number, Mode=TwoWay}" />
                                                </Grid>
                                            </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>
                                </StackPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </Border>

            </StackPanel>
        </ScrollViewer>
    </Grid>
</local:ChartExBase>
